package org.itsolutions.javaBackup.logger;


import java.io.Serializable;


/**
 * 
 * @author Tomas Fecko
 */
public interface ILogger extends Serializable {

	/**
	 * 
	 * @param pLevel level of log
	 * @param pMessage log message
	 */
	void log(ELogLevel pLevel, Object... pMessage);
	
	/**
	 * 
	 * @param pLevel level
	 * @param pThrowable throwable
	 */
	void log(ELogLevel pLevel, Throwable pThrowable);
	
	/**
	 * 
	 * @param pLevel level 
	 * @param pThrowable throwable
	 * @param pMessageParts message parts
	 */
	void log(ELogLevel pLevel, Throwable pThrowable, Object... pMessageParts);
	
	/**
	 * Push message to nested diagnostic context.
	 * @param pMessage message
	 */
	void push(String pMessage);
	
	/**
	 * Pop message from nested diagnostic context. Pop returns the message and remove it from NDC.
	 * @return TID
	 */
	String pop();
	
	/**
	 * Peek returns the message from NDC, but leaves it there. 
	 * @return TID
	 */
	String peek();
	
	/**
	 * Inserts key and value to MDC.
	 * @param pKey key
	 * @param pValue value
	 */
	void put(String pKey, String pValue);
	
	/**
	 * Gets value from MDC.
	 * @param pKey key
	 * @return value
	 */
	String get(String pKey);
	
	/**
	 * Removes value from MDC.
	 * @param pKey key
	 */
	void remove(String pKey);
	
	/**
	 * 
	 * @param pLogLevel log level
	 * @return true if is enabled logger for the log level
	 */
	boolean isEnabledFor(ELogLevel pLogLevel);
}














